﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Entities;

namespace Sample.Novel.Domain.Book.Entites
{
    //章节 
    public class Chapter : Entity<Guid>, IHasCreationTime
    {
        public Volume Volume { get; set; }
        public Guid VolumeId { get; set; }

        public string Title { get; set; }
        //章节的正文是实体 一对一的关系
        public ChapterText ChapterText { get; protected set; }

        public int WordsNumber { get; set; } 

        public DateTime CreationTime { get; }

        protected Chapter()
        { 
        
        }

        public Chapter(string title,string conter)
        {
            Title = Check.NotNullOrWhiteSpace(title,nameof(title));
            WordsNumber = conter.Length;
        }
     
    
    }
}
